home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
cstdio.arc
/
SRC.ARC
/
FFLUSH.C
< prev
next >
Wrap
C/C++ Source or Header
|
1984-07-23
|
454b
|
24 lines
/* fflush.c - flush a stream buffer.
(C) Copyright 1984 Gregory R. Mansfield - All Rights Reserved.
G. R. Mansfield. 84/07/23.
Ver 1.0-4723.
*/
#include "stdio.h"
int fflush(fp)
FILE *fp;
{
int l;
if ((fp->_flag & _WRITE) == 0 || fp->_base == NULL)
return(EOF);
l = fp->_ptr - fp->_base;
if (write(fp->_fd, fp->_base, l) != l) {
fp->_flag |= _ERR;
return(ERR);
}
fp->_ptr = fp->_base;
fp->_cnt = BUFSIZE - 1;
}